
// 三条线
function publicLineThree(opt) {
    var initDom = document.getElementById(opt.id);
    let echartsDom = echarts.init(initDom);
    echartsDom.clear();

    var nameData = [], ltData = [], scData = [], cyData = [];
    opt.data.forEach(function (item) {
        nameData.push(item.name);
        ltData.push(item.lt);
        scData.push(item.sc);
        cyData.push(item.cy)
    })
    var option = {
        legend: {
            show: true,
            icon: 'circle',
            itemWidth: 10,
            itemHeight: 10,
            itemGap: 25,
            textStyle: {
                fontSize: 14,
                color: '#333',
                padding: [3, 0, 0, 0]
            },
        },
        grid: {
            top: '15%',
            left: '5%',
            right: '3%',
            bottom: '25%',
            // containLabel: true
        },
        tooltip: {
            trigger: 'axis'
        },
        xAxis: [{
            type: 'category',
            data: nameData,
            axisLine: {
                lineStyle: {
                    color: '#ddd'
                }
            },
            axisTick: {
                show: false
            },
            axisLabel: {
                interval: 0,
                textStyle: {
                    color: '#6c757d'
                },
                margin: 15
            },
            boundaryGap: false
        }],
        yAxis: [{
            type: 'value',
            min:80,
            axisTick: {
                show: false
            },
            axisLine: {
                lineStyle: {
                    color: '#ddd'
                }
            },
            axisLabel: {
                textStyle: {
                    color: '#6c757d'
                }
            },
            splitLine: {
                show: false
            }
        }],
        series: [{
            name: '生产',
            type: 'line',
            data: scData,
            symbolSize: 6,
            symbol: 'circle',
            smooth: true,
            lineStyle: {
                color: '#ffbc53'
            },
            itemStyle: {
                normal: {
                    color: '#ffbc53',
                    borderColor: '#ffbc53'
                }
            },
            areaStyle: {
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                    offset: 0,
                    color: '#ffbc53b3'
                },
                {
                    offset: 1,
                    color: '#ffbc5303'
                }
                ])
            },
            emphasis: {
                itemStyle: {
                    color: {
                        type: 'radial',
                        x: 0.5,
                        y: 0.5,
                        r: 0.5,
                        colorStops: [{
                            offset: 0,
                            color: '#ffbc53'
                        },
                        {
                            offset: 0.4,
                            color: '#ffbc53'
                        },
                        {
                            offset: 0.5,
                            color: '#fff'
                        }, {
                            offset: 0.7,
                            color: '#fff'
                        }, {
                            offset: 0.8,
                            color: '#fff'
                        }, {
                            offset: 1,
                            color: '#fff'
                        }
                        ]
                    },
                    borderColor: '#ffbc53',
                    borderWidth: 2
                }
            }
        }, {
            name: '流通',
            type: 'line',
            data: ltData,
            symbolSize: 6,
            symbol: 'circle',
            smooth: true,
            lineStyle: {
                color: '#008ffb'
            },
            itemStyle: {
                normal: {
                    color: '#008ffb',
                    borderColor: '#008ffb'
                }
            },
            areaStyle: {
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                    offset: 0,
                    color: '#008ffbb3'
                },
                {
                    offset: 1,
                    color: '#008ffb03'
                }
                ])
            },
            emphasis: {
                itemStyle: {
                    color: {
                        type: 'radial',
                        x: 0.5,
                        y: 0.5,
                        r: 0.5,
                        colorStops: [{
                            offset: 0,
                            color: '#008ffb'
                        },
                        {
                            offset: 0.4,
                            color: '#008ffb'
                        },
                        {
                            offset: 0.5,
                            color: '#fff'
                        }, {
                            offset: 0.7,
                            color: '#fff'
                        }, {
                            offset: 0.8,
                            color: '#fff'
                        }, {
                            offset: 1,
                            color: '#fff'
                        }
                        ]
                    },
                    borderColor: '#008ffb',
                    borderWidth: 2
                }
            }
        }, {
            name: '餐饮',
            type: 'line',
            data: cyData,
            symbolSize: 6,
            symbol: 'circle',
            smooth: true,
            lineStyle: {
                color: '#6e6bfa'
            },
            itemStyle: {
                normal: {
                    color: '#6e6bfa',
                    borderColor: '#6e6bfa'
                }
            },
            areaStyle: {
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                    offset: 0,
                    color: '#6e6bfab3'
                },
                {
                    offset: 1,
                    color: '#6e6bfa03'
                }
                ])
            },
            emphasis: {
                itemStyle: {
                    color: {
                        type: 'radial',
                        x: 0.5,
                        y: 0.5,
                        r: 0.5,
                        colorStops: [{
                            offset: 0,
                            color: '#6e6bfa'
                        },
                        {
                            offset: 0.4,
                            color: '#6e6bfa'
                        },
                        {
                            offset: 0.5,
                            color: '#fff'
                        }, {
                            offset: 0.7,
                            color: '#fff'
                        }, {
                            offset: 0.8,
                            color: '#fff'
                        }, {
                            offset: 1,
                            color: '#fff'
                        }
                        ]
                    },
                    borderColor: '#6e6bfa',
                    borderWidth: 2
                }
            }
        }
        ]
    };
    echartsDom.setOption(option);
}